package com.woniuxy.rabbitmqspringboot.dead;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @Author zhangyong
 * @Date 2021/8/12 0012下午 3:35
 */
@Component
public class DeadConsumer {

    @RabbitListener(queues = "dead_queue")
    public void consumer(String data){
        //打印接收到消息的时间
        System.out.println("死信消费者收到消息的时间："+new Date());

        System.out.println(data);
    }
}
